//
//  JGQualityInfo.h
//  JGVividEngine
//
//  Created by jagger.tu on 2025/3/13.
//

#import <Foundation/Foundation.h>
#import <JGVividEngine/JGVividEngineDataDefine.h>


NS_ASSUME_NONNULL_BEGIN

/// 质量信息模型
@interface JGQualityInfo : NSObject
///时间戳
@property (nonatomic, assign) uint64_t timestampMs;
/// 公网rtt -- 已废弃， 无数据
@property (nonatomic, assign) NSInteger rtt;
/// 公网丢包率 -- 已废弃 ， 无数据
@property (nonatomic, assign) NSInteger lossSec;
///// rtc rtt -- 同`packetLossRate`
//@property (nonatomic, assign) NSInteger webrtcRtt;
///// rtc  丢包率 -- 同 `roundTripTime`
//@property (nonatomic, assign) NSInteger webrtcLossRate;
/// 端到端到解码时的延迟
@property (nonatomic, assign) NSInteger decodeDelay;
/// 端到端到渲染时的延迟
@property (nonatomic, assign) NSInteger renderDelay;
/// 渲染帧率
@property (nonatomic, assign) NSInteger renderFps;
/// 接收帧率
@property (nonatomic, assign) NSInteger receiveFps;
/// 解码帧率
@property (nonatomic, assign) NSInteger decoderFps;
/// 当前屏幕刷新率
@property (nonatomic, assign) NSInteger screenFps;
/// 视频流类型
@property (nonatomic, assign) JGVideoStreamType videoStreamType;
/// 视频流名称
@property (nonatomic, strong) NSString *videoStreamName;
/// 视频码率 kbps
@property (nonatomic, assign) NSInteger videoRecieveBitrate;
/// 视频FEC冗余码率 kbps
@property (nonatomic, assign) NSInteger videoRecieveFecBitrate;
/// 视频重传码率 kbps
@property (nonatomic, assign) NSInteger videoRecieveRetransmitBitrate;
/// 视频编码码率 kbps
@property (nonatomic, assign) NSInteger videoRecieveMediaBitrate;
/// 音频流类型
@property (nonatomic, assign) JGAudioStreamType audioStreamType;
/// 音频流名称
@property (nonatomic, strong) NSString *audioStreamName;
/// 音频码率 kbps
@property (nonatomic, assign) NSInteger audioRecieveBitrate;
/// 音频FEC冗余码率 kbps
@property (nonatomic, assign) NSInteger audioRecieveFECBitrate;
/// 音频编码码率 kbps
@property (nonatomic, assign) NSInteger audioRecieveMediaBitrate;
///// 渲染每秒卡顿数 -- 同 `rendererJankCount`
//@property (nonatomic, assign) NSInteger renderJankCountSec;
///// 渲染每秒严重卡顿数 -- 同`rendererBigJankCount`
//@property (nonatomic, assign) NSInteger renderBigJankCount;
///// 接收每秒卡顿数 -- 同`assembleJankCount`
//@property (nonatomic, assign) NSInteger reviceJankCountSec;
///// 接收每秒严重卡顿数 -- 同`assembleBigJankCount`
//@property (nonatomic, assign) NSInteger reviceBigJankCount;
/// 是后台
@property (nonatomic, assign) BOOL isBackground;
/// 是否开启了超分
@property (nonatomic, assign) BOOL isSuperReslution;
/// 超分宽
@property (nonatomic, assign) int supperReslutionWidth;
/// 超分宽
@property (nonatomic, assign) int supperReslutionHeight;

/// 是否包含扩展数据
@property (nonatomic, assign) BOOL bExpandedData;

#pragma mark - 新增
/// 总接收码率
@property (nonatomic, assign) NSInteger totalRecieveBitrate;
/// 视频平均组帧耗时
@property (nonatomic, assign) NSInteger videoAvgAssembleDelay;
/// 视频最大组帧耗时
@property (nonatomic, assign) NSInteger videoMaxAssembleDelay;

/// 视频平均jitter buffer耗时
@property (nonatomic, assign) NSInteger videoAvgQueueOrScheduleDelay;
/// 视频最大jitter buffer耗时
@property (nonatomic, assign) NSInteger videoMaxQueueOrScheduleDelay;

/// 视频平均解码耗时
@property (nonatomic, assign) NSInteger videoAvgDecodeDelay;
/// 视频最大解码耗时
@property (nonatomic, assign) NSInteger videoMaxDecodeDelay;

/// 接收第一个包开始到解码结束平均耗时(新增)
@property (nonatomic, assign) NSInteger videoAvgRecvStartToDecodeEndDelay;
/// 接收第一个包开始到解码结束最大耗时(新增)
@property (nonatomic, assign) NSInteger videoMaxRecvStartToDecodeEndDelay;

/// 接收第一个包开始到渲染结束平均耗时(新增)
@property (nonatomic, assign) NSInteger videoAvgRecvStartToRendererEndDelay;
/// 接收第一个包开始到渲染结束最大耗时(新增)
@property (nonatomic, assign) NSInteger videoMaxRecvStartToRendererEndDelay;

/// 指令从采集到投递到RTC的平均耗时(新增)
@property (nonatomic, assign) NSInteger controlSendAvgAppProcessDelay;
///指令从采集到投递到RTC的最大耗时(新增)
@property (nonatomic, assign) NSInteger controlSendMaxAppProcessDelay;

///指令在RTC中线程切换的平均耗时(新增)
@property (nonatomic, assign) NSInteger controlSendAvgNetworkScheduleDelay;
///指令在RTC中线程切换的最大耗时(新增)
@property (nonatomic, assign) NSInteger controlSendMaxNetworkScheduleDelay;

/// 指令在RTC中平滑排队平均耗时(新增)
@property (nonatomic, assign) NSInteger controlSendAvgQueueDelay;
/// 指令在RTC中平滑排队的最大耗时(新增)
@property (nonatomic, assign) NSInteger controlSendMaxQueueDelay;

/// 指令从采集到发送到网络的平均耗时(新增)
@property (nonatomic, assign) NSInteger controlSendAvgDelay;
/// 指令从采集到发送到网络的的最大耗时(新增)
@property (nonatomic, assign) NSInteger controlSendMaxDelay;

/// RTC丢包率(新增)
@property (nonatomic, assign) NSInteger packetLossRate;
/// WebRTC RTT(新增)
@property (nonatomic, assign) NSInteger roundTripTime;

/// 组帧卡顿总时长
@property (nonatomic, assign) NSInteger assembleJankTime;
/// 组帧卡顿总次数
@property (nonatomic, assign) NSInteger assembleJankCount;
/// 组帧严重卡顿总时长
@property (nonatomic, assign) NSInteger assembleBigJankTime;
/// 组帧严重卡顿总次数
@property (nonatomic, assign) NSInteger assembleBigJankCount;

/// 解码卡顿总时长
@property (nonatomic, assign) NSInteger decodeJankTime;
/// 解码卡顿总次数
@property (nonatomic, assign) NSInteger decodeJankCount;
/// 解码严重卡顿总时长
@property (nonatomic, assign) NSInteger decodeBigJankTime;
/// 解码严重卡顿总次数
@property (nonatomic, assign) NSInteger decodeBigJankCount;

/// 渲染卡顿总时长
@property (nonatomic, assign) NSInteger rendererJankTime;
/// 渲染卡顿总次数
@property (nonatomic, assign) NSInteger rendererJankCount;
/// 渲染严重卡顿总时长
@property (nonatomic, assign) NSInteger rendererBigJankTime;
/// 渲染严重卡顿总次数
@property (nonatomic, assign) NSInteger rendererBigJankCount;
/// 实际游玩时长 ms
@property (nonatomic, assign) NSInteger playTime;


- (NSString *)description;

@end

NS_ASSUME_NONNULL_END
